package com.ay277.htqoa.staff.entity;

import com.ay277.htqoa.base.entity.BaseEntity;
import com.ay277.htqoa.base.entity.User;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by accp09 on 2016/12/7.
 */
@Entity
@Table(name = "tb_Emp")
public class Emp extends BaseEntity {
    //员工姓名
    private String name;
    //密码
    private String pwd;
    //性别
    private String sex;
    //登录ID
    private User login;
    //入职时间
    private Date hirDate;
    //状态 1.在职 2.离职 3.休假
    private int state;
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }
    public Date getHirDate() {
        return hirDate;
    }

    public void setHirDate(Date hirDate) {
        this.hirDate = hirDate;
    }

    @ManyToOne
    @JoinColumn(name = "Login",unique = true)
    public User getLogin() {
        return login;
    }

    public void setLogin(User login) {
        this.login = login;
    }

    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    //对应部门关系
   private Dept depts;
    @ManyToOne
    @JoinColumn(name = "deptid")
    public Dept getDepts() {
        return depts;
    }

    public void setDepts(Dept depts) {
        this.depts = depts;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

}
